# -*- encoding:utf-8  -*-
import socket

if __name__ == '__main__':
    host = "127.0.0.1"
    port = 12001
    # 迎接套接字
    server = socket.socket()
    address = (host, port)
    server.bind(address)
    # 请求最大数量5（最少为1）
    server.listen(5)
    while True:
        # 新建一个新的连接socket
        c, addr = server.accept()
        print c, addr
        print c.recv(2048)
        server.send("hello,iam tcp")
        c.close()
